@model NewsLetterSubscriptionTypeModel

<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />

<section class="content">
    <div class="container-fluid">
        <div class="form-horizontal">
            <div class="cards-group">
                @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.NewsLetterSubscriptionTypeTop, additionalData = Model })
                <div class="card card-default">
                    <div class="card-body">
                        @(await Html.LocalizedEditorAsync<NewsLetterSubscriptionTypeModel, NewsLetterSubscriptionTypeLocalizedModel>("subscription-type-localized",
                                @<div>
                                    <div class="form-group row">
                                        <div class="col-md-3">
                                            <nop-label asp-for="@Model.Locales[item].Name" />
                                        </div>
                                        <div class="col-md-9">
                                            <nop-editor asp-for="@Model.Locales[item].Name" />
                                            <span asp-validation-for="@Model.Locales[item].Name"></span>
                                        </div>
                                    </div>
                                    <input type="hidden" asp-for="@Model.Locales[item].LanguageId" />
                                </div>
                        ,
                                @<div>
                                    <div class="form-group row">
                                        <div class="col-md-3">
                                            <nop-label asp-for="Name" />
                                        </div>
                                        <div class="col-md-9">
                                            <nop-editor asp-for="Name" asp-required="true" />
                                            <span asp-validation-for="Name"></span>
                                        </div>
                                    </div>
                                </div>
                      ))
                        <div class="form-group row">
                            <div class="col-md-3">
                                <nop-label asp-for="SelectedStoreIds" />
                            </div>
                            <div class="col-md-9">
                                <div class="row">
                                    <div class="col-md-3">
                                        <nop-select asp-for="SelectedStoreIds" asp-items="Model.AvailableStores" asp-multiple="true" />
                                        <script>
                                            $(function() {
                                                var storesIdsInput = $('#@Html.IdFor(model => model.SelectedStoreIds)').select2({
                                                    closeOnSelect: false,
                                            @if (!Model.AvailableStores.Any())
                                            {
                                                <text>
                                                        disabled: true,
                                                        placeholder: 'No stores available',
                                                </text>
                                            }
                                                });
                                            });
                                        </script>
                                    </div>
                                    <div class="col-md-9">
                                        @await Component.InvokeAsync(typeof(MultistoreDisabledWarningViewComponent))
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group row">
                            <div class="col-md-3">
                                <nop-label asp-for="DisplayOrder" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="DisplayOrder" />
                                <span asp-validation-for="DisplayOrder"></span>
                            </div>
                        </div>
                        <div class="form-group row">
                            <div class="col-md-3">
                                <nop-label asp-for="TickedByDefault" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="TickedByDefault" />
                                <span asp-validation-for="TickedByDefault"></span>
                            </div>
                        </div>
                    </div>
                </div>
                @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.NewsLetterSubscriptionTypeBottom, additionalData = Model })
            </div>
        </div>
    </div>
</section>